package com.quanquan.store.entity;

import lombok.Data;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;

/**
 * @ClassName:Coupon
 * @Description:TODO
 * @Author:xiongjunbao
 * @Date:2019/3/15 16:53
 * @Version 1.0
 */
@Data
@Entity
@Table(name = "oo_coupon")
public class Coupon implements Serializable {

    @Id
    @Column(name = "id", unique = true, length = 64)
    private String id;
    /**
     * 券名
     */
    @Column(name = "name", length = 32)
    private String name;

    @Column(name = "create_time", length = 32)
    private String createTime;
    /**
     * 券类型
     */
    @Column(name = "type", nullable = false, columnDefinition = "TINYINT default 0")
    private Integer type;
    /**
     * 优惠券简介
     */
    @Column(name = "coupon_desc")
    private String couponDesc;

    /**
     * 1、积分兑换券  2、积分+金额兑换券 3、金额
     */
    @Column(name = "value_type", columnDefinition = "TINYINT default 0")
    private Integer valueType;
    /**
     * 券价值积分
     */
    @Column(name = "integral", columnDefinition = "INT")
    private Integer integral;
    /**
     * 券价格
     */
    @Column(name = "price",  length = 32)
    private String price;
    /**
     * 折扣方式 1折扣券 2.现金抵用券 3、时长券
     */
    @Column(name = "dis_type")
    private Integer disType;
    /**
     * 折扣值 dis_type 值为1时表示折扣 2时为抵用价格
     */
    @Column(name = "dis_value", columnDefinition = "INT")
    private Integer disValue;
    /**
     * 现价格
     */
    @Column(name = "now_price", columnDefinition = "INT")
    private Integer nowPrice;
    /**
     * 原价格
     */
    @Column(name = "old_price", columnDefinition = "INT")
    private Integer oldPrice;

    /**
     * 兑换时间限制种类 1.指定日期 2.领取优惠券后指定小时数 3.领取当天
     */
    @Column(name = "use_time_type", length = 32)
    private Integer useTimeType;
    /**
     * 优惠券生效时间
     */
    @Column(name = "use_time_start", length = 32)
    private String useTimeStart;
    /**
     * use_time_type 等于1是有效 优惠券使用的最后期限日期
     */
    @Column(name = "use_time_end", length = 32)
    private String useTimeEnd;
    /**
     *当use_time_type等于2时有效用户领取优惠券之后优惠券的有效小时数
     */
    @Column(name = "use_time_hour")
    private Integer useTimeHour;

    /**
     * 券库存类型 0限量 1不限量
     */
    private Integer sumType;

    /**
     * 券总量
     */
    @Column(name = "sum_tatal", columnDefinition = "INT default 0")
    private Integer sumTatal;
    /**
     * 券剩余量
     */
    @Column(name = "remain_total", columnDefinition = "INT default 0")
    private Integer remainTotal;
    /**
     * 排序凭证
     */
    @Column(name = "sort_order", columnDefinition = "INT")
    private Integer sortOrder;

    /**
     * 券状态 0下架  1上架
     */
    @Column(name = "status", columnDefinition = "TINYINT default 0")
    private Integer status;
    /**
     * 是否热门商品 1热门 0普通
     */
    @Column(name = "status_hot", columnDefinition = "TINYINT default 0")
    private Integer statusHot;

    private String image;

    /**
     * 当前优惠券每天可以购买的最大数量
     */
    private Integer count;

    /**
     * 使用规则
     */
    @Column(name = "use_rule", columnDefinition = "text")
    private String useRule;

    /**
     * 券大图
     */
    @Column(name = "picture", columnDefinition = "text")
    private String picture;

    @Column(name = "status_show", columnDefinition = "TINYINT default 0")
    private Integer statusShow;

    /**
     * 开始购买时间
     */
    private String buyTimeStart;

    /**
     * 结束购买时间
     */
    private String buyTimeEnd;

    /**
     * 优惠券有效期内限制购买数量
     */
    private Integer buyTimeCount;

    /**
     * 展示开始时间
     */
    private String showTimeStart;

    /**
     * 展示结束时间
     */
    private String showTimeEnd;

    /**
     * 绑定的类型 1-绑定商户 2-绑定业态
     */
    private Integer bindType;

    /**
     * 秒杀商品数
     */
    @Column(name = "shopping_kill_num", columnDefinition = "INT default 0")
    private Integer shoppingKillNum;

    /**
     * 成本
     */
    private Double cost;

}
